package cn.iocoder.yudao.module.erp.service.dpeast;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.erp.controller.admin.dpitem.dpeastlistdx.vo.DpEastListDxPageReqVO;
import cn.iocoder.yudao.module.erp.controller.admin.dpitem.dpeastlistdx.vo.DpEastListDxSaveReqVO;
import cn.iocoder.yudao.module.erp.dal.dataobject.dplist.DpEastListDxDO;
import cn.iocoder.yudao.module.erp.dal.mysql.dpeast.DpEastListDxMapper;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;

import javax.annotation.Resource;

/**
 * 东线口岸仓东线清单 Service 实现类
 *
 * @author 天使管理员
 */
@Service
@Validated
public class DpEastListDxServiceImpl implements DpEastListDxService {

    @Resource
    private DpEastListDxMapper dpEastListDxMapper;

    @Override
    public Long createDpEastListDx(DpEastListDxSaveReqVO createReqVO) {
        // 插入
        DpEastListDxDO dpEastListDx = BeanUtils.toBean(createReqVO, DpEastListDxDO.class);
        dpEastListDxMapper.insert(dpEastListDx);
        // 返回
        return dpEastListDx.getId();
    }

    @Override
    public void updateDpEastListDx(DpEastListDxSaveReqVO updateReqVO) {
        DpEastListDxDO updateObj = BeanUtils.toBean(updateReqVO, DpEastListDxDO.class);
        dpEastListDxMapper.updateById(updateObj);
    }

    @Override
    public void deleteDpEastListDx(Long id) {
        dpEastListDxMapper.deleteById(id);
    }

    @Override
    public DpEastListDxDO getDpEastListDx(Long id) {
        return dpEastListDxMapper.selectById(id);
    }

    @Override
    public PageResult<DpEastListDxDO> getDpEastListDxPage(DpEastListDxPageReqVO pageReqVO) {
        return dpEastListDxMapper.selectPage(pageReqVO);
    }

}